#---------  ------------#

#1.exit modelsim simulation
quit -sim

#2.clear messages
.main clear

#3.delete the existing work dir
if [file exists work] {vdel -all}

#--------- create library and mapping ------------#
#4.creat work dir
vlib work

#5.
vmap work work

#6.complie .v files
vlog -work work ./dark_light_correction_tb.v
vlog -work work ../src/master/Master_axi_stream_v1_0.v
vlog -work work ../src/master/Master_axi_stream_v1_0_M00_AXIS.v

#7.start simulation
vsim -voptargs=+acc work.dark_light_correction_tb

#8.add waves
	#add -divider { name }
add wave -group dark_light_correction_tb -radix unsigned dark_light_correction_tb/*
add wave -group axi_stream_v1_0 -radix unsigned dark_light_correction_tb/inst_Master_axi_stream_v1_0/*

#add wave -group Fpa_dlc640 -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/*
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/int_cnt
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/vcnt
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/h_valid
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/v_valid
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/hcnt
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/fifo_wr_data_test_2
#add wave -group check -radix unsigned dark_light_correction_tb/inst_Fpa_dlc640/Fifo_data_valid
#add wave -group timing_640x480 -radix unsigned dark_light_correction_tb/inst_timing_640x480/*

#9.run
run 40ms